package info.ferrarimarco.itEbooksDownloader.controller;

import java.util.List;

public class BookDownloaderTask implements Runnable{

	private int bookIndexStart;
	private int bookIndexEnd;
	private final String tagStart;
	private final String tagEnd;
	private final String destinationPath;
	private final List<String> bookNames;
	private final String baseUrl;
	
	private List<String> result;
	
	public BookDownloaderTask(int startIndex, int endIndex, String tagStart, String tagEnd, String destinationPath, List<String> bookNames, String baseUrl) {
		super();
		this.bookIndexStart = startIndex;
		this.bookIndexEnd = endIndex;
		this.tagStart = tagStart;
		this.tagEnd = tagEnd;
		this.destinationPath = destinationPath;
		this.bookNames = bookNames;
		this.baseUrl = baseUrl;
	}
	
	@Override
	public void run() {
		result = BookDownloader.downloadBooks(bookIndexStart, bookIndexEnd, tagStart, tagEnd, destinationPath, bookNames, baseUrl);
	}

	public List<String> getResult() {
		return result;
	}

	public void setResult(List<String> result) {
		this.result = result;
	}
}
